﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;

namespace Web.frontStage
{
    public partial class videoLib : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null == Session["username"])
            {
                Response.Write("<script> alert ('请先登录')</script>");
                Response.Redirect("index.aspx");
            }

            if (!BLL.videoLib.VideoManager.GetVideoById(Int32.Parse(Request.QueryString["videoId"])).IsTry && Int32.Parse(Session["leftDayNum"].ToString()) <= 0) 
            {
                Response.Write("<script> alert ('你的点数不足，请先充值')</script>");
                Response.Redirect("charge.aspx");
            }

            if (this.IsPostBack)
            {
                return;
            }

            BLL.videoLib.VideoManager.FillTreeView(TreeView1);
        }
    }
}
